﻿package app.view.components.sections.expo 
{
	import app.model.types.SectionType;
	import app.model.vo.SectionVO;
	import app.view.components.sections.LabeledSectionBase;
	import app.view.events.UIEvent;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	/**
	 * 1.4 КНИГА ОТЗЫВОВ И ПРЕДЛОЖЕНИЙ
	 * @author Dmitryi_Koruagin, icq:585466579, dmitryikoruagin@mail.ru, skype: ok_ru1
	 */
	public class ExpoFeedBeaksDBase extends LabeledSectionBase
	{
		// app.view.components.sections.expo.ExpoFeedBeaksDBase
		
		public var writeMessageBtn:MovieClip;
		
		public function ExpoFeedBeaksDBase() 
		{
			super();
			
		}
		
		private function setEvents():void
		{
			writeMessageBtn.addEventListener(MouseEvent.CLICK, OnClickWriteMessage);
		}
		
		
		private function removeEvents():void
		{
			writeMessageBtn.removeEventListener(MouseEvent.CLICK, OnClickWriteMessage);
		}
		
		
		override public function onDestroy():void 
		{
			// чистим что тут есть и вызываем супера
			
			
			
			super.onDestroy();
		};
		
		override public function get data():Object { return _data; };
		
		override public function set data(value:Object):void 
		{
			super.data = value;
			
			////trace('data!!!',_data.data);
			
			setEvents();
		};
		
		private function OnClickWriteMessage(e:MouseEvent):void 
		{
			
			removeEvents();
			
			var obj:SectionVO = new SectionVO();
			obj.id = SectionType.PAGE_EXPO_FEEDBACK_WRITE;
			obj.currentId = id;
			obj.params = null;
			
			var ev:UIEvent = new UIEvent(UIEvent.SECTION_CHANGE);
			ev.data = obj;
			dispatchEvent(ev);
			
		}
		
	}

}